package cn.com.dhcc.turbo.entity.registry;

import java.util.Date;

import cn.com.dhcc.app.core.annotation.SiColumn;
import cn.com.dhcc.app.core.annotation.SiNotDbColumn;
import cn.com.dhcc.app.core.annotation.SiTable;
import cn.com.dhcc.app.core.base.ModuleFeatureBean;

@SiTable(name="TURBO_EXCH_CON_REQUEST")
public class ExchConnRequest extends ModuleFeatureBean{

	@SiColumn(isId=true)
	private String id;//	varchar2(32)	
	@SiColumn(name="FROM_NODE_ID")
	private String fromNodeId;//from_node	varchar2(32)			请求发起方
	@SiColumn(name="TO_URL")
	private String toUrl;//	varchar2(32)	y		被请求方url
	@SiColumn(name="REQUEST_CONTENT")
	private String requestContent;//	clob			请求内容
	@SiColumn(name="REQUEST_TYPE")
	private String requestType;//	char(1)			请求类型：1 请求注册为子节点 2 请求建立交换关系 
	private String status;//	char(1)			请求状态：1 同意 0 不同意
	private String response;//	varchar2(1000)	y		反馈内容
	private String isLocal;//是否是本节点发起的请求 0 否1 是
	private Date mtime;//修改时间
	@SiNotDbColumn
	private String fromNodeName;//请求发起方节点名称
	public String getFromNodeName() {
		return fromNodeName;
	}
	public void setFromNodeName(String fromNodeName) {
		this.fromNodeName = fromNodeName;
	}
	public Date getMtime() {
		return mtime;
	}
	public void setMtime(Date mtime) {
		this.mtime = mtime;
	}
	public static enum RequestType{
		//REGIST("1"),
		EXCH_REL("2");
		private String type;
		RequestType(String type){
			this.type = type;
		}
		public String getType() {
			return type;
		}
		
	}
	
	public static enum RequestStatus{
		ERROR("3","审核异常"),
		WAIT("2","待审核"),
		PASS("1","通过"),
		BLOCK("0","不通过");
		private String code;
		private String name;
		RequestStatus(String code,String name){
			this.code = code;
			this.name = name;
		}
		public String getName() {
			return name;
		}
		public String getCode() {
			return code;
		}
		
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}

	
	public String getFromNodeId() {
		return fromNodeId;
	}
	public void setFromNodeId(String fromNodeId) {
		this.fromNodeId = fromNodeId;
	}
	
	public String getToUrl() {
		return toUrl;
	}
	public void setToUrl(String toUrl) {
		this.toUrl = toUrl;
	}
	public String getRequestContent() {
		return requestContent;
	}
	public void setRequestContent(String requestContent) {
		this.requestContent = requestContent;
	}
	public String getRequestType() {
		return requestType;
	}
	public void setRequestType(String requestType) {
		this.requestType = requestType;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getResponse() {
		return response;
	}
	public void setResponse(String response) {
		this.response = response;
	}
	
	public String getIsLocal() {
		return isLocal;
	}
	public void setIsLocal(String isLocal) {
		this.isLocal = isLocal;
	}
	@Override
	public String toString() {
		return "ExchConnRequest [id=" + id + ", fromNodeId=" + fromNodeId
				+ ", toUrl=" + toUrl + ", requestContent=" + requestContent
				+ ", requestType=" + requestType + ", status=" + status
				+ ", response=" + response + ", isLocal=" + isLocal
				+ ", mtime=" + mtime + ", fromNodeName=" + fromNodeName + "]";
	}
}
